package Services;

import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;

import Donnees.Client;
import dao.Implementation.ClientDAO;

@ManagedBean
public class sClient {
	List<Client> listeClient = new ArrayList<Client>();
	ClientDAO clientDao = new ClientDAO();
	Client client = new Client();
	
	public sClient(){
		listeClient = getListeClient();
	}
	public List<Client> getListeClient() {
		listeClient = clientDao.selectAll();
		return listeClient;
	}

	public void insertClient(Client s) {
		clientDao.insert(s);
	}
	public void deleteClient(Client s) {
		clientDao.delete(s);
	}
	public Client getClientById(long id) {
		client = clientDao.getById(id);
		return client;
	}
}
